const mongoose = require('mongoose')

const Schema = mongoose.Schema; // 设计数据库模型

// 连接数据库
mongoose.connect('mongodb://localhost/blog', {
  useNewUrlParser: true,
  useUnifiedTopology: true
});


// 消息内容  
const commentSchema = new Schema({
  topic_id: { // 文章id
    type: String,
    required: true
  },
  user: [{
    user_id:String,
    comment: String
  }]
})



module.exports = mongoose.model('Comment', commentSchema);